Skip to content

docs: replace RFC copy-paste docstrings with Pythonic docstrings#1385

Open
ykd007 wants to merge 3 commits into
collective:mainfrom
ykd007:fix/issue-1244-pythonic-docstrings
Open

docs: replace RFC copy-paste docstrings with Pythonic docstrings#1385
ykd007 wants to merge 3 commits into
collective:mainfrom
ykd007:fix/issue-1244-pythonic-docstrings

Conversation

@ykd007
Copy link
Copy Markdown

@ykd007 ykd007 commented May 14, 2026

See #1244

Rewrites RFC copy-paste docstrings across Alarm, Component, and Calendar into clean Pythonic format with concise summaries, examples, and see-also references.

Updated (12 properties across 3 files):

  • Alarm: ACKNOWLEDGED, TRIGGER
  • Component: DTSTAMP/stamp, LAST_MODIFIED, CREATED
  • Calendar: calendar_name, description, color, prodid, version, calscale, method, refresh_interval

All 3 files pass py_compile syntax check.

…lective#1244)

Rewrote RFC-verbatim docstrings for the following properties:

alarm.py:
- Alarm.ACKNOWLEDGED: replaced RFC 9074 Purpose/Description wall-of-text
  with a concise summary, Return, Example and See also sections.
- Alarm.TRIGGER: replaced RFC 5545 Purpose/Value-Type verbatim with a
  clear summary, type info, Example and See also.

component.py:
- Component.DTSTAMP / stamp: replaced 'RFC 5545: Conformance/Description'
  block with a Pythonic summary, context note, Example and See also.
- Component.LAST_MODIFIED: same pattern - Pythonic summary, Example, See also.
- Component.CREATED: same pattern - Pythonic summary, Example, See also.

calendar.py:
- Calendar.calendar_name: removed Property Parameters/Conformance/Description
  RFC headings; added See also.
- Calendar.description: same cleanup.
- Calendar.color: removed Property Parameters/Conformance/Description RFC
  headings; added CSS3 link reference and See also.
- Calendar.prodid: replaced Conformance/Description verbatim with Pythonic
  summary, Example and See also.
- Calendar.version: replaced Purpose RFC text with Pythonic summary + Example.
- Calendar.calscale: replaced Conformance/Description/Compatibility with
  Pythonic summary, RFC 7529 note, Example and See also.
- Calendar.method: replaced Description RFC block with Pythonic summary,
  iTIP/RFC 5546 reference, Example and See also.
- Calendar.refresh_interval: replaced Conformance/Description headings with
  Pythonic summary, updated Raises, added Example and See also.
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 14, 2026

@stevepiercy
Copy link
Copy Markdown
Member

@ykd007 would you please resolve the merge conflicts by moving your change log entry into the new format that we adopted in 7.1.2, as documented at https://icalendar.readthedocs.io/en/stable/contribute/index.html#change-log-entry-format?

@stevepiercy
Copy link
Copy Markdown
Member

@ykd007 would you also edit your PR description from Closes #1244 to See #1244? We don't want to close it until all the docstrings are checked off the list.

Copy link
Copy Markdown
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is phenomenal work! Thank you!

There are some weird prepended and appended docstrings from a parent method that I'd like to see added to this PR, which will improve other docstrings automatically.

The change log needs to be moved, per the release of 7.1.1, and described in https://icalendar.readthedocs.io/en/stable/contribute/index.html#change-log-entry-format.

Other than that, I pretty much had only grammar and style fixes.

changed in the alarm component. If the value of any "ACKNOWLEDGED" property
in the alarm changes and is greater than or equal to the trigger time of the alarm,
then clients SHOULD dismiss or cancel any "alert" presented to the calendar user.
"""The UTC datetime at which this alarm was last sent or acknowledged.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I looked at the rendered docs, I found that there was a snippet prepended to this docstring. Would you please revise the following:

https://github.com/stevepiercy/icalendar/blob/8c26d2b22ce33c37bd2bfce7997ca240641236ab/src/icalendar/attr.py#L401-L415

Specifically, and possibly wrapped after using make format:

-        f"""The {name} property. datetime in UTC
+        f"""The {name} property with all values converted to a :class:`~datetime.datetime` in UTC.

-    All values will be converted to a datetime in UTC.
+ 

The two blank lines will ensure proper concatenation with a new paragraph to begin the description of the docstring.

Suggested change
"""The UTC datetime at which this alarm was last sent or acknowledged.
"""This property is the UTC datetime at which this alarm was last sent or acknowledged as defined in :rfc:`9074`.

then clients SHOULD dismiss or cancel any "alert" presented to the calendar user.
"""The UTC datetime at which this alarm was last sent or acknowledged.

Defined in :rfc:`9074`. Setting this property allows calendar clients to
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved into previous paragraph.

Suggested change
Defined in :rfc:`9074`. Setting this property allows calendar clients to
Setting this property allows calendar clients to

Defined in :rfc:`9074`. Setting this property allows calendar clients to
dismiss or suppress an alarm across multiple devices. Once set to a value
greater than or equal to the alarm's computed trigger time, conforming clients
will not re-fire the alarm.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
will not re-fire the alarm.
will not refire the alarm.

>>> from icalendar import Alarm
>>> alarm = Alarm()
>>> alarm.ACKNOWLEDGED = datetime(2024, 1, 15, 10, 0, 0, tzinfo=timezone.utc)
>>> alarm.ACKNOWLEDGED # doctest: +ELLIPSIS
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline comments don't render. Is the comment necessary?

Suggested change
>>> alarm.ACKNOWLEDGED # doctest: +ELLIPSIS
>>> alarm.ACKNOWLEDGED

datetime.datetime(2024, 1, 15, 10, 0, tzinfo=...)

See also:
:attr:`TRIGGER` — the time at which the alarm fires.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:attr:`TRIGGER` the time at which the alarm fires.
:attr:`TRIGGER`, the time at which the alarm fires.

Comment on lines +648 to +649
Analogous to a file's modification timestamp. This property is optional;
when absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Analogous to a file's modification timestamp. This property is optional;
when absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`.
It's analogous to a file's modification timestamp. This property is optional.
When it's absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`.

Analogous to a file's modification timestamp. This property is optional;
when absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`.

Applicable to ``VEVENT``, ``VTODO``, ``VJOURNAL``, and ``VTIMEZONE``
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Applicable to ``VEVENT``, ``VTODO``, ``VJOURNAL``, and ``VTIMEZONE``
This property is applicable to ``VEVENT``, ``VTODO``, ``VJOURNAL``, and ``VTIMEZONE``

store.
"""The UTC datetime when this calendar component was first created, per :rfc:`5545#section-3.8.7.1`.

Records when the calendar user agent originally stored the component.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Records when the calendar user agent originally stored the component.
This property records when the calendar user agent originally stored the component.

"""The UTC datetime when this calendar component was first created, per :rfc:`5545#section-3.8.7.1`.

Records when the calendar user agent originally stored the component.
This property is optional; when absent, :attr:`created` falls back to
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This property is optional; when absent, :attr:`created` falls back to
This property is optional. When it's absent, :attr:`created` falls back to

The property can be specified once in "VEVENT",
"VTODO", or "VJOURNAL" calendar components. The value MUST be
specified as a date with UTC time.
Applicable to ``VEVENT``, ``VTODO``, and ``VJOURNAL`` components.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Applicable to ``VEVENT``, ``VTODO``, and ``VJOURNAL`` components.
This property is applicable to ``VEVENT``, ``VTODO``, and ``VJOURNAL`` components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants